package controller

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"strconv"
	"ucenter/app"
	"ucenter/utils"
)

func ReferrerUrl(c *gin.Context) {
	uid := c.GetInt64("UID")
	if uid == 0 {
		return
	}
	code, err := utils.IdEncode(int(uid))
	if err != nil {
		code = strconv.FormatInt(int64(uid), 10)
	}
	c.JSON(200, &map[string]string{"url": fmt.Sprintf(app.Conf.LandingPage, code)})
	return
}
